{
    // 获取对象类型

    const obj = {
        a: 1,
        b: "two",
        [Symbol("c")]: true
    };

    type o = typeof obj;
    /**
     * 等同于
     * type o = {
     *   [x: symbol]: boolean;
     *   a: number;
     *   b: string;
     * }
     */

}

{
    // 获取函数类型
    function merge(target: object, ...source: any[]): object {
        return target
    }

    type funType = typeof merge

}

{
    // 类的构造签名
    class Person {
        name: string;
        age: number;
        constructor(name: string, age: number) {
            this.name = name;
            this.age = age;
            /**
             * 默认情况下, 返回该类的实例，且忽略不写
             * return this;
             *  */ 
        }
    }

    type PConstruct = typeof Person;

    type PConstruct2 = new (name: string, age: number) => Person

    
}

{ 
    // as const 与 typeof 

    const arr = ["North", "West", "Eath", "South"]

    const array = ["North", "West", "Eath", "South"] as const;

    // number关键字，联合类型
    type arrSign = typeof array[number]


    const obj = {
        Up: 0,
        Down: 1,
        Left: 2,
        Right: 3
    } as const;

    type valuesType =  typeof obj[keyof typeof obj];
}